<!--
 * @Description: 
 * @Author: linzejian
 * @Date: 2021-09-27 10:07:20
 * @LastEditTime: 2022-02-14 11:13:11
 * @LastEditors: linZeJian
-->
<template>
  <div>
    <van-search
      v-model="searchValue"
      show-action
      placeholder="请输入搜索关键词"
      @search="onSearch"
    >
      <template #action>
        <div @click="onSearch">搜索</div>
      </template>
    </van-search>
  </div>
</template>
<script lang="ts" setup>
import { ref } from "vue";


// defineEmits,defineProps无需导入，直接使用
const emits = defineEmits(['searchFun']);
const props = defineProps({
	searchValue: {
		type: String,
		defaule: ''
	}
});

const onSearch  = () => {
	emits('searchFun', props.searchValue) // 向父组件传递数据
}

</script>